You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > TVec Class > TVec Methods > TVec.SetSubRange Method
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
TVec.SetSubRange Method

Defines the calling vector to have the view of the same memory as Src.

Syntax
C#
Visual Basic
public void SetSubRange([In] TMtxVec Src);

Src vector's Length property may not change while any other object has it's own view of it. 

 

a.SetSubRange(b,..);

 

This SetSubRange method must be handled with great care. Namely:

  • b can be freed before "a" and accessing "a" gives AV.
  • a can be further subranged with c and same problem occurs when b is freed before c.
  • If you resize b, all objects which have subranged b

are no longer pointing to valid memory.

  • b can Subrange other objects. Similar problem as

when changing the size of b. Again all objects which have subranged b are not longer pointing to valid memory. 

All this can lead to hard to find bugs.

TVec.SetSubRange, TMtxVecBase.SetFullRange

Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!